package com.boesch.electroOffice.business.businessObjectImpl;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.boesch.electroOffice.business.businessObject.MeasurementBusinessObject;
import com.boesch.electroOffice.business.common.BusinessException;
import com.boesch.electroOffice.dataaccess.common.IllegalDataAccessException;
import com.boesch.electroOffice.dataaccess.dao.MeasurementDao;
import com.boesch.electroOffice.model.electroOffice.Measurement;
import com.liferay.portal.model.User;

@Service
public class MeasurementBusinessObjectImpl implements MeasurementBusinessObject {

	@Autowired
	private MeasurementDao measurementDao;
	
	public Measurement readMeasurementById(Integer measurementId)
			throws BusinessException, IllegalDataAccessException {
		return measurementDao.readMeasurementById(measurementId);
	}

	public String saveMeasurement(Measurement measurement, User currentUser)
			throws BusinessException, IllegalDataAccessException {
		return measurementDao.saveMeasurementOnDatabase(measurement,
				currentUser);
	}

	public String updateMeasurement(Measurement measurement, User currentUser)
			throws BusinessException, IllegalDataAccessException {
		return measurementDao.updateMeasurementOnDatabase(measurement,
				currentUser);
	}
}
